//
//  ThemeViewController.m
//  TravelWorld
//
//  Created by dllo on 15/5/21.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "ThemeViewController.h"
#define ITEM_SPACING 200
@interface ThemeViewController ()

@end

@implementation ThemeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"主题城市";
    self.ic = [[iCarousel alloc] initWithFrame:CGRectMake(30, 30, self.view.frame.size.width - 60, self.view.frame.size.height - 64 - 99)];
    self.ic.dataSource = self;
    self.ic.delegate = self;
    self.ic.type = iCarouselTypeCylinder;
    [self.view addSubview:self.ic];
    

}



- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
    return 30;
}

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
{
    //    UIView *view = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%ld.jpg",index]]] autorelease];
    
    //    view.frame = CGRectMake(70, 80, 180, 260);
    
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 0, 200, 460);
    button.backgroundColor = [UIColor greenColor];
    [button addTarget:self action:@selector(cityImageButton) forControlEvents:UIControlEventTouchUpOutside];
    UIImage *image = [UIImage imageNamed:@"WorldBG.png"];
    [button setImage:image forState:UIControlStateNormal];
    [self.view addSubview:button];

    return button;
}

- (void)cityImageButton
{
    
    
    
    [self.navigationController pushViewController:nil animated:YES];
}



- (NSUInteger)numberOfPlaceholdersInCarousel:(iCarousel *)carousel
{
    return 0;
}

- (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel
{
    return 10;
}

- (CGFloat)carouselItemWidth:(iCarousel *)carousel
{
    return ITEM_SPACING;
}



- (BOOL)carouselShouldWrap:(iCarousel *)carousel
{
    return YES;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
